package weifei.live.simulation.im.cmd;


import lombok.Data;

/**
 * 给 客户端 的 通知
 * */
@Data
public class Notice
{
    public enum Type
    {
        Message,    // 消息
        Error,      // 错误
        UserException   // 异常，用户异常行为一类
    }

    public Type type;
    public String message;

    private Notice(Type type, String message)
    {
        this.type = type;
        this.message = message;
    }

    public static Notice message(String message) { return new Notice(Type.Message, message); }
    public static Notice error(String message) { return new Notice(Type.Error, message); }
    public static Notice userException(String message) { return new Notice(Type.UserException, message); }
}


